Skip to content

Conversation

@zapp88
Copy link

@zapp88 zapp88 commented Jun 28, 2025

Related GitHub Issue

#4225

Closes: #4225

Description

This PR adds a new command git.generateCommitMessage that generates a commit message based on the staged changes. It also adds translations for this command in all supported languages.

Test Procedure

  1. Stage some changes in a git repository.
  2. Open the Source Control view.
  3. Click on the "Generate Commit Message" button.
  4. Verify that a commit message is generated and inserted into the commit message box.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

obraz
obraz

Additional Notes

This commit introduces a simpler approach to #4225.

While this solution doesn't perfectly replicate Copilot's behavior due to its reliance on an unstable API, it provides a minimum viable product. I believe that "perfect is the enemy of good," and delivering essential functionality now is preferable to waiting for a more feature-rich solution in the future. This approach allows for iterative improvements on the existing implementation.

Get in Touch

zapp88


Important

Introduces AI-powered commit message generation with new command, settings, and tests.

  • Feature:
    • Adds git.generateCommitMessage command in registerCommands.ts to generate commit messages using AI.
    • Integrates AI commit message generation with language settings in ClineProvider.ts and webviewMessageHandler.ts.
    • Adds translations for the new command in multiple language files.
  • Configuration:
    • Updates package.json to include the new command and its settings.
    • Adds aiCommitMessages to experiments.ts and global-settings.ts.
  • Testing:
    • Introduces generateCommitMessage.spec.ts for testing the new feature.
  • Miscellaneous:
    • Updates experiment.ts to include aiCommitMessages.
    • Adds UI elements for commit language settings in LanguageSettings.tsx.

This description was created by Ellipsis for 69aa82d. You can customize this summary. It will automatically update as commits are pushed.

@zapp88 zapp88 requested review from cte, jr and mrubens as code owners June 28, 2025 08:33
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 28, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 28, 2025
zapp88 added 5 commits June 28, 2025 10:48
Moves the "Generating commit message" notification from VS Code's static NLS to the dynamic i18next infrastructure, ensuring it gets properly translated.

- Simplifies the translation key to `git.generatingCommitMessage`.
- Fixes the i18n setup script to resolve the correct locales path.
- Stabilizes the `t()` helper to prevent race conditions with language changes.
- Removes the now-obsolete key from all `package.nls.*.json` files to clean up the codebase.
Adds translations for pluginLanguage and commitLanguage to the settings panel for all supported languages.

This ensures that the language selection options in the settings view are properly localized, improving the user experience for non-English speakers.
Adds a comprehensive suite of unit tests for the `generateCommitMessage` function.

The tests cover the following scenarios:
- Git extension not found
- No Git repository found
- No changes in the repository
- AI provider not configured
- Successful commit message generation for tracked files
- Successful commit message generation for untracked files
- Handling of errors when reading untracked files

This ensures the stability and correctness of the commit message generation feature.
@zapp88 zapp88 changed the title "feat: Add translations for generate commit message command" "feat: Roo AI-Powered Commit Message Generation" Jun 28, 2025
@zapp88 zapp88 changed the title "feat: Roo AI-Powered Commit Message Generation" feat: Roo AI-Powered Commit Message Generation Jun 28, 2025
@daniel-lxs
Copy link
Member

Thank you for your contribution!

As mentioned in #2173 (comment), we don't believe this change makes sense at this time, especially since many extensions are already adding buttons to the SCM title bar.

At the very least, we would want to provide users with the option to turn it off. Otherwise, it adds yet another button to an already crowded interface like this:
image

I'll mark this PR as a draft for now to give us more time for discussion.

@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jun 28, 2025
@daniel-lxs daniel-lxs marked this pull request as draft June 28, 2025 15:54
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 28, 2025
This commit introduces a new experimental feature that uses AI to generate commit messages based on the staged change
@zapp88
Copy link
Author

zapp88 commented Jun 28, 2025

Thank you for your contribution!

As mentioned in #2173 (comment), we don't believe this change makes sense at this time, especially since many extensions are already adding buttons to the SCM title bar.

At the very least, we would want to provide users with the option to turn it off. Otherwise, it adds yet another button to an already crowded interface like this: image

I'll mark this PR as a draft for now to give us more time for discussion.

The new functionality is implemented behind an experimental feature toggle that is off by default. This lets us develop the feature iteratively without impacting users who don't wish to use it."

obraz

@zapp88 zapp88 marked this pull request as ready for review June 28, 2025 18:17
zapp88 and others added 3 commits June 28, 2025 22:35
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…ages experimental feature

The commit language setting has been refactored and moved from the general language settings section. It is now managed by a new dedicated component, .

This component is conditionally rendered within the  section, specifically when the  experimental feature is active. This change ensures that the commit language option is logically grouped with the AI commit message functionality it directly supports, improving the clarity and organization of settings.

Additionally, minor styling adjustments were applied to the  component for improved layout.
@hannesrudolph
Copy link
Collaborator

We only want to implement this in the ai powered commit message if the button for activating it is here (see image)
image
image

See issue scoping. If VS Code has not fixed their API to properly allow this then we will wait until they have.

@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jul 7, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Draft / In Progress size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Feature Request: Roo AI-Powered Commit Message Generation

3 participants